/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package delta.productcatalog.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Kate
 */
@Entity
@Table(name = "CATEGORY")
@NamedQueries({
    @NamedQuery(name = "Category.findAll", query = "SELECT c FROM Category c"),
    @NamedQuery(name = "Category.findByIdCategory", query = "SELECT c FROM Category c WHERE c.idCategory = :idCategory"),
    @NamedQuery(name = "Category.findByName", query = "SELECT c FROM Category c WHERE c.name = :name")})

public class Category implements Serializable {
    private static final long serialVersionUID = 1L;
@Id
    @GeneratedValue(generator="Seq_category")
    @SequenceGenerator(name="Seq_category", sequenceName="Seq_category_id_category", allocationSize=1)

@Column(name = "id_category")
    int id_category;  
@Column(name = "name")
@NotNull
    String name;

    public int getId_category() {
        return id_category;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    
}
